
// MIT License
// 
// Copyright (c) 2009-2017 Luca Piccioni
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// 
// This file is automatically generated

#pragma warning disable 649, 1572, 1573

// ReSharper disable RedundantUsingDirective
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;

using Khronos;

// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable JoinDeclarationAndInitializer

namespace OpenGL
{
	public partial class Glx
	{
		/// <summary>
		/// [GLX] Value of GLX_BUFFER_CLOBBER_MASK_SGIX symbol.
		/// </summary>
		[RequiredByFeature("GLX_SGIX_pbuffer")]
		[Log(BitmaskName = "GLXEventMask")]
		public const uint BUFFER_CLOBBER_MASK_SGIX = 0x08000000;

		/// <summary>
		/// [GLX] Value of GLX_SAMPLE_BUFFERS_BIT_SGIX symbol.
		/// </summary>
		[RequiredByFeature("GLX_SGIX_pbuffer")]
		[Log(BitmaskName = "GLXPbufferClobberMask")]
		public const uint SAMPLE_BUFFERS_BIT_SGIX = 0x00000100;

		/// <summary>
		/// [GLX] Value of GLX_OPTIMAL_PBUFFER_WIDTH_SGIX symbol.
		/// </summary>
		[RequiredByFeature("GLX_SGIX_pbuffer")]
		public const int OPTIMAL_PBUFFER_WIDTH_SGIX = 0x8019;

		/// <summary>
		/// [GLX] Value of GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX symbol.
		/// </summary>
		[RequiredByFeature("GLX_SGIX_pbuffer")]
		public const int OPTIMAL_PBUFFER_HEIGHT_SGIX = 0x801A;

		/// <summary>
		/// [GLX] glXCreateGLXPbufferSGIX: Binding for glXCreateGLXPbufferSGIX.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="config">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="width">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="height">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="attrib_list">
		/// A <see cref="T:int[]"/>.
		/// </param>
		[RequiredByFeature("GLX_SGIX_pbuffer")]
		public static IntPtr CreateGLXPbufferSGIX(IntPtr dpy, IntPtr config, uint width, uint height, int[] attrib_list)
		{
			IntPtr retValue;

			unsafe {
				fixed (int* p_attrib_list = attrib_list)
				{
					Debug.Assert(Delegates.pglXCreateGLXPbufferSGIX != null, "pglXCreateGLXPbufferSGIX not implemented");
					retValue = Delegates.pglXCreateGLXPbufferSGIX(dpy, config, width, height, p_attrib_list);
					LogCommand("glXCreateGLXPbufferSGIX", retValue, dpy, config, width, height, attrib_list					);
				}
			}
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [GLX] glXDestroyGLXPbufferSGIX: Binding for glXDestroyGLXPbufferSGIX.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="pbuf">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		[RequiredByFeature("GLX_SGIX_pbuffer")]
		public static void DestroyGLXPbufferSGIX(IntPtr dpy, IntPtr pbuf)
		{
			Debug.Assert(Delegates.pglXDestroyGLXPbufferSGIX != null, "pglXDestroyGLXPbufferSGIX not implemented");
			Delegates.pglXDestroyGLXPbufferSGIX(dpy, pbuf);
			LogCommand("glXDestroyGLXPbufferSGIX", null, dpy, pbuf			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GLX] glXQueryGLXPbufferSGIX: Binding for glXQueryGLXPbufferSGIX.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="pbuf">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="attribute">
		/// A <see cref="T:int"/>.
		/// </param>
		/// <param name="value">
		/// A <see cref="T:uint[]"/>.
		/// </param>
		[RequiredByFeature("GLX_SGIX_pbuffer")]
		public static int QueryGLXPbufferSGIX(IntPtr dpy, IntPtr pbuf, int attribute, uint[] value)
		{
			int retValue;

			unsafe {
				fixed (uint* p_value = value)
				{
					Debug.Assert(Delegates.pglXQueryGLXPbufferSGIX != null, "pglXQueryGLXPbufferSGIX not implemented");
					retValue = Delegates.pglXQueryGLXPbufferSGIX(dpy, pbuf, attribute, p_value);
					LogCommand("glXQueryGLXPbufferSGIX", retValue, dpy, pbuf, attribute, value					);
				}
			}
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [GLX] glXSelectEventSGIX: Binding for glXSelectEventSGIX.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="mask">
		/// A <see cref="T:uint"/>.
		/// </param>
		[RequiredByFeature("GLX_SGIX_pbuffer")]
		public static void SelectEventSGIX(IntPtr dpy, IntPtr drawable, uint mask)
		{
			Debug.Assert(Delegates.pglXSelectEventSGIX != null, "pglXSelectEventSGIX not implemented");
			Delegates.pglXSelectEventSGIX(dpy, drawable, mask);
			LogCommand("glXSelectEventSGIX", null, dpy, drawable, mask			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GLX] glXGetSelectedEventSGIX: Binding for glXGetSelectedEventSGIX.
		/// </summary>
		/// <param name="dpy">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="drawable">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="mask">
		/// A <see cref="T:uint[]"/>.
		/// </param>
		[RequiredByFeature("GLX_SGIX_pbuffer")]
		public static void GetSelectedEventSGIX(IntPtr dpy, IntPtr drawable, [Out] uint[] mask)
		{
			unsafe {
				fixed (uint* p_mask = mask)
				{
					Debug.Assert(Delegates.pglXGetSelectedEventSGIX != null, "pglXGetSelectedEventSGIX not implemented");
					Delegates.pglXGetSelectedEventSGIX(dpy, drawable, p_mask);
					LogCommand("glXGetSelectedEventSGIX", null, dpy, drawable, mask					);
				}
			}
			DebugCheckErrors(null);
		}

		internal static unsafe partial class Delegates
		{
			[RequiredByFeature("GLX_SGIX_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate IntPtr glXCreateGLXPbufferSGIX(IntPtr dpy, IntPtr config, uint width, uint height, int* attrib_list);

			[RequiredByFeature("GLX_SGIX_pbuffer")]
			internal static glXCreateGLXPbufferSGIX pglXCreateGLXPbufferSGIX;

			[RequiredByFeature("GLX_SGIX_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glXDestroyGLXPbufferSGIX(IntPtr dpy, IntPtr pbuf);

			[RequiredByFeature("GLX_SGIX_pbuffer")]
			internal static glXDestroyGLXPbufferSGIX pglXDestroyGLXPbufferSGIX;

			[RequiredByFeature("GLX_SGIX_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate int glXQueryGLXPbufferSGIX(IntPtr dpy, IntPtr pbuf, int attribute, uint* value);

			[RequiredByFeature("GLX_SGIX_pbuffer")]
			internal static glXQueryGLXPbufferSGIX pglXQueryGLXPbufferSGIX;

			[RequiredByFeature("GLX_SGIX_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glXSelectEventSGIX(IntPtr dpy, IntPtr drawable, uint mask);

			[RequiredByFeature("GLX_SGIX_pbuffer")]
			internal static glXSelectEventSGIX pglXSelectEventSGIX;

			[RequiredByFeature("GLX_SGIX_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glXGetSelectedEventSGIX(IntPtr dpy, IntPtr drawable, uint* mask);

			[RequiredByFeature("GLX_SGIX_pbuffer")]
			internal static glXGetSelectedEventSGIX pglXGetSelectedEventSGIX;

		}
	}

}
